const express = require('express');
const router = express.Router();
const CategoryController = require('../controllers/categoryController');
const adminAuth = require('../middleware/adminAuth');

// 公开接口
router.get('/areas', CategoryController.getAllAreas);
router.get('/genres', CategoryController.getAllGenres);

// 管理端接口（需要管理员权限）
router.post('/admin/area', adminAuth, CategoryController.createArea);
router.post('/admin/genre', adminAuth, CategoryController.createGenre);
router.put('/admin/area/:id', adminAuth, CategoryController.updateArea);
router.put('/admin/genre/:id', adminAuth, CategoryController.updateGenre);
router.delete('/admin/area/:id', adminAuth, CategoryController.deleteArea);
router.delete('/admin/genre/:id', adminAuth, CategoryController.deleteGenre);

module.exports = router;